<template>
  <view>
	<u-navbar :is-back="false" title="拜访"
	  title-size="30"
	  :background="{background:'#2B88FE' }"
	  title-color="#fff">
	  <div class="head_icon">
	    <u-icon @click="$api.handleBackTo"
	      name="arrow-left" color="#fff"
	      size="36">
	    </u-icon>
	    <u-icon @click="$api.handleHomeTo"
	      name="home" color="#fff" size="36">
	    </u-icon>
	  </div>
	</u-navbar>
  <CommDetail :cid="cid" :info="info" :current="1" class="detail-table">
    <u-table>
      <u-tr>
        <u-th width="50%">拜访时间
        </u-th>
        <u-th>是否成交</u-th>
        <u-th>操作</u-th>
      </u-tr>
      <u-tr v-for="(item,index) in list" :key="index">
        <u-td width="50%">
          {{item.VisitTime}}
        </u-td>
        <u-td>
          {{item.fIsBuy===10?'是':'否'}}
        </u-td>
        <u-td>
          <navigator :url="`/pages/sale/visit_records_data?id=${item.fId}&fMrkId=${item.fMrkId}`">
            <div class="yi">查看
            </div>
          </navigator>
        </u-td>
      </u-tr>
    </u-table>
    <u-empty text="暂无数据" mode="list" v-if="!list.length">
    </u-empty>
  </CommDetail>
  </view>
</template>

<script>
import CommDetail from './commdetail'
export default {
  components: { CommDetail },
  data() {
    return {
      cid: 0,
      info: {},
      list: [],
	  form: {
	    IsBuy: 0,
	    MrkId: 0,
	    Key: ''
	  }
    }
  },
  onLoad(e) {
    this.cid = Number(e.id)
    this.form.MrkId=this.cid
    this.$axios('api/MrkBasic/GetDetail', 'post', {
      value: e.id
    }).then(res => {
      console.log(res)
      this.info = res.Value
      this.loading = false
    })
    this.$axios('api/UserVisit/ListPaged', 'post', { value: this.form  }).then(res => {
      this.list = res.Value.List
    })
  }
}
</script>

<style lang="scss" scoped>
.detail-table {
  background-color: #fff;
  margin: 40rpx 0;
}
</style>